{extend name="public:member" /}
{block name="head_css"}
<link rel="stylesheet" href="__RES__/member/css/aftersales.css" />
{/block}
{block name="content"}
<div id="location">
	<div class="allWrap">
		<a href="{$Request.root.true}">首页</a><span>></span><a href="{:url('Aftersales/choice',array('id'=>input('param.id')))}">售后服务</a><span>></span><a>{$title}</a>
	</div>
</div>
<div id="refund" class="allWrap">
	
	<div id="step">		
		{if condition="1 eq $type"}		
			<ul class="three">
				<li>1.买家申请{$title}</li>
				<li class="on">2.商家处理{$title}申请</li>
				<li>3.商家处理完成</li>
			</ul>
		{else/}		
			<ul class="four">
				<li>1.买家申请{$title}</li>				
				<li class="on">2.买家退货给商家</li>
				<li>3.商家处理{$title}申请</li>
				<li>4.商家处理完成</li>
			</ul>
		{/if}
	</div>
	
	<div class="order_pro"></div>	
	
	<div id="apply"></div>		
	
	{if condition="2 eq $type"}		
		<div id="refund_form">			
			<h2>退货物流信息</h2>
			<ul>				
				<li>
					<span><i>*</i>物流公司：</span>
					<input id="express_name" name="express_name" class="text" style="width:300px;" type="text" />
				</li>
				<li>
					<span><i>*</i>物流单号：</span>
					<input id="invoice_no" name="invoice_no" class="text" style="width:300px;" type="text" />
				</li>
				
				<li>				
					<button id="apply_button" class="button">提交申请</button>				
				</li>
			</ul>
		</div>
		<script>
		$(function(){
			$('#apply_button').click(function(){
				$.post(
					'{:url("Aftersales/refund_express")}',
					{
						express_name:$('#express_name').val(),
						invoice_no:$('#invoice_no').val(),
						rid:'{:input("param.rid")}',
						order_id:'{:input("param.order_id")}'
					},
					function(d){
						if(d.success){
							art.dialog({
								content:d.success,
								lock: true,
								ok: function () {
									location = d.url;
								}				    
							});	
						}
						if(d.error){
							art.dialog({content:d.error, lock: true});
						}
					}
				);
			});
		});		
		</script>
	{/if}
	
</div>

{/block}
{block name="javascript"}
<script>
$('.order_pro').load('<?php echo url("Aftersales/goods_list",array("id"=>input("param.order_id"))); ?>');
$('#apply').load('<?php echo url("Aftersales/refund_reason",array("id"=>input("param.rid"))); ?>');
</script>
{/block}